const old_arr = [1,2,2,2,3,4,4]
const new_set = new Set(old_arr)
const new_arr = [...new_set]
console.log(new_arr) //[ 1, 2, 3, 4 ]